package controler;
import com.opensymphony.xwork2.ActionSupport;
/**
 * Created by hui on 2017/6/9.
 */
public class LoginAction extends ActionSupport {
    //两个属性名跟Login.jsp的form属性的name一样
    //这样struts2框架会自动复制，每个属性需要getter和setter
    private String username;
    private String pwd;
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public String getPwd() {
        return pwd;
    }
    public void setPwd(String pwd) {
        this.pwd = pwd;
    }
    @Override
    public String execute() throws Exception {
        String forword = null;
        if(username.equals("Hitvz")&&pwd.equals("123456")){
            forword = ActionSupport.SUCCESS;
        }else {
            forword = ActionSupport.INPUT;
        }
        return forword;
    }
}
